package co.baiku.boot.handle;


import co.baiku.boot.response.item.AppleVerifyReceiptInApp;

import java.util.Map;

public interface ApplePayHandle<T> {

    void onMessage(Map<String, Object> params) throws Exception;

    /**
     * 获取订单
     *
     * @param params
     * @return
     */
    T getByOutTradeNo(Map<String, Object> params);

    /**
     * 检查是否已经处理过本次事务,如果处理过返回true继续后面的流程,如果处理过返回false,忽略本次返回
     *
     * @param inApp 凭据
     * @param order 订单
     * @return
     */
    Boolean checkOrder(T order, AppleVerifyReceiptInApp inApp);

    void business(T order, AppleVerifyReceiptInApp inApp);
}
